﻿using Koala.Pro.Common;
using Koala.Pro.Core.Dto;
using Koala.Pro.Core.Models;
using Koala.Pro.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Koala.Pro.Services
{
    public interface IRoleService : IMyCrudService<RoleInfo, int, RolePagedDto>, ITransientDependency, IDependency
    {
        Task<List<RoleInfo>> GetRolesByOu(int ouID);

        Task<List<RoleInfo>> GetRolesByFunction(string functionID);

        Task<List<RoleInfo>> GetRolesByUser(int userID);

        Task<List<RoleInfo>> GetRolesByCompany(string companyId);

        Task<List<OuInfo>> GetMyTopGroup();

        Task<bool> AddFunction(string functionID, int roleID);

        Task<bool> AddOU(int ouID, int roleID);

        Task<bool> AddUser(int userID, int roleID);

        Task<bool> RemoveFunction(string functionID, int roleID);

        Task<bool> RemoveOU(int ouID, int roleID);

        Task<bool> RemoveUser(int userID, int roleID);

        Task<bool> AddMenu(string menuID, int roleID);

        Task<bool> RemoveMenu(string menuID, int roleID);

        Task<bool> SetDeletedFlag(int id, bool deleted = true);

        Task<bool> UserInRole(string userName, string roleName);

        Task<bool> UserIsAdmin(string userName);

        Task<bool> OUInRole(int ouID, string roleName);

        Task<List<TreeNodeItem>> GetRoleCategories();

        Task<bool> UpdateRoleFunctions(UpdateRoleFunctionsDto dto);

        Task<bool> UpdateRoleMenus(UpdateRoleMenusDto dto);
    }
}
